<script setup>
import {ref,onMounted} from 'vue';
import http from '@/untils/http.js'
const uesr = ref(null)

const list = ref([])

const getUserList=async()=>{
    const response = await http.get("/uesr/list")
    list.value=response.data;
};


onMounted(()=>{
    console.log('请求用户信息')
    getUserList()
})


</script>


<template>
    <div>
        <h1>个人中心</h1>
        <el-row v-if="list-length>0">
            <el-col :span="4">
                <el-card v-for="user in list" :key="user.id">
                    <p>{{ user?.name }}</p>
                    <p>{{ user?.gender }}</p>
                    <p>{{ user?.birthday }}</p>
                    <p>{{ user?.email}}</p>
                    <p>{{ user?.bio }}</p>
                    <el-button :href="/user/id">查看详情</el-button>
                </el-card>
                
            </el-col>
            
        </el-row>
    </div>
</template>